package com.example.membersteward.controller;

import com.example.membersteward.common.CommonResult;
import com.example.membersteward.entity.vo.UserVo;
import com.example.membersteward.service.FileService;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
@RestController
public class FileController {

    @Resource
    FileService fileService;

    @GetMapping("/api/downloadTemp")
    public CommonResult downloadTemp()  {
        return fileService.downloadTemp();
    }

    @PostMapping("/api/exportUserInfo")
    public CommonResult exportUserInfo(@RequestBody UserVo user)  {
        return fileService.exportUserInfo(user);
    }

    @RequestMapping("/api/uploadUser")
    public CommonResult uploadUserInfo(@RequestPart("file") MultipartFile file) {
        return fileService.uploadUserInfo(file);
    }
}
